<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    //声明一个set
    let s = new Set();
    let s2 = new Set(['xx','yy','zz','xx']);
    console.log(s2.size)
    console.log(s,typeof s);

    //添加新元素
    s2.add('xs');
    console.log(s2);

    //清空集合
    //s2.clear();
    for (let v of s2){
        console.log(v);
    }

    let arr = [1,2,3,4,5,6,2,3,4];
    //1.数组去重
    let result = [...new Set(arr)];
    console.log(result);

</script>

</body>
</html>